<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title><%= htmlWebpackPlugin.options.title %></title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
    <!-- 引入自适应类库，不建议在main.js 里引入. -->
    <!-- <script src="//unpkg.com/vue-ydui/dist/ydui.flexible.js"></script> -->
    <script type='text/javascript' src='./static/mui.min.js'></script>
    <script>
    ! function(e) {
      var t = e.document,
          n = t.documentElement,
          i = "orientationchange" in e ? "orientationchange" : "resize",
          a = function e() {
              var t = n.getBoundingClientRect().width;
              return n.style.fontSize = 5 * Math.max(Math.min(t / 750 * 20, 11.2), 8.55) + "px", e
          }();
      n.setAttribute("data-dpr", e.navigator.appVersion.match(/iphone/gi) ? e.devicePixelRatio : 1), /iP(hone|od|ad)/.test(e.navigator.userAgent) && (t.documentElement.classList.add("ios"), parseInt(e.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1], 10) >= 8 && t.documentElement.classList.add("hairline")), t.addEventListener && (e.addEventListener(i, a, !1), t.addEventListener("DOMContentLoaded", a, !1))
    }(window);
    mui.init({
      keyEventBind: {
        backbutton: true  // 关闭back按键监听
      }
    });
    // 首页返回键处理
    // 处理逻辑：1秒内，连续两次按返回键，则退出应用；
    var first = null;
    mui.back = function() {
    // 首次按键，提示‘再按一次退出应用’
    if (!first) {
      first = new Date().getTime();//记录第一次按下回退键的时间
      mui.toast('再按一次退出应用');//给出提示
      history.go(-1)//回退到上一页面
      setTimeout(function() {//1s中后清除
        first = null;
      }, 1000);
    } else {
        if (new Date().getTime() - first < 1000) {//如果两次按下的时间小于1s，
            plus.runtime.quit();//那么就退出app
        } 
      }
    };
    </script>
  </head>
  <body style="background-color: #ffffff">
    <div id="app"></div>
    <div style="text-align:center;font-size: .1rem;color: #f5f5f5;"> 最后部署时间: <%=process.env.PUBLICTIME%></div>
    <!-- built files will be auto injected -->
    <script src="./static/iconfont/iconfont.js"></script>
    <%if (process.env.IS_LOG == 'on') {%>
      <script src="//res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/vconsole/3.0.0/vconsole.min.js"></script>
      <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
      <script>
        new VConsole()
      </script>
    <%}%>
  </body>
</html>
